"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
// 装饰器工厂在TS中的使用
var MessageDecoratorFactory = function (type) {
    var content;
    switch (type) {
        case 'text':
            content = 'text';
            break;
        case 'music':
            content = 'musci';
            break;
        default:
            content = 'no message';
    }
    return function (target) {
        target.prototype.message = function () {
            console.log(content);
        };
    };
};
{
    var Text_1 = /** @class */ (function () {
        function Text() {
        }
        Text = __decorate([
            MessageDecoratorFactory('text')
        ], Text);
        return Text;
    }());
    var Music = /** @class */ (function () {
        function Music() {
        }
        Music = __decorate([
            MessageDecoratorFactory('music')
        ], Music);
        return Music;
    }());
    var Message = /** @class */ (function () {
        function Message() {
        }
        Message = __decorate([
            MessageDecoratorFactory()
        ], Message);
        return Message;
    }());
    new Text_1().message();
    new Music().message();
    new Message().message();
}
